home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / FifoFacility.h,v < prev    next >
Text File  |  1989-06-25  |  1KB  |  85 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:1.1; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     88.09.18.16.42.04;  author grunwald;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @#ifndef FIFO_FACILITYH
  26. #define FIFO_FACILITYH
  27.  
  28. #include "FifoSemaphore.h"
  29. #include "TimeContainer.h"
  30.  
  31. class Thread;
  32.  
  33. //
  34. //    This is why you need multiple inheritence.
  35. //
  36. class FifoFacility : public FifoSemaphore {
  37.  
  38.     protected: 
  39.  
  40.     short servers;
  41.     struct {
  42.     double single;    // valid when servers == 1
  43.     double *many;    // valid when servers > 1
  44.     } whenServiced;
  45.  
  46.     double serviceStarted;
  47.     double totalServiceTime;
  48.     int pTotalReserves;
  49.  
  50.     TimeContainer *time;            // our measure of time
  51.  
  52.     virtual void reportErrorState(ostream&);
  53.     void commonReserve();
  54.  
  55.     public :
  56.  
  57.     FifoFacility(int servers = 1,
  58.          TimeContainer *time = 0,
  59.          bool debug = FALSE);
  60.  
  61.     ~FifoFacility();
  62.  
  63.     virtual void reserve();
  64.     virtual void release();
  65.     virtual bool reserveNoBlock();
  66.  
  67.     virtual void use(double);
  68.  
  69.     virtual void reset();
  70.  
  71.     virtual double utilization();
  72.     virtual int totalReserves();
  73.  
  74.     virtual bool isEmpty();
  75.  
  76.     virtual unsigned queueLength();
  77.     virtual unsigned activeServers();
  78.     virtual unsigned size();
  79.  
  80.     virtual void classPrintOn(ostream& s);
  81. };
  82.  
  83. #endif FIFO_FACILITYH
  84. @
  85.